package extendandpolymorphism;

/**
 * @author shkstart
 * @date 2022/5/11 - 12:57
 */
public class Cylinder extends Circle {
    private double length;

    public Cylinder() {
        length = 1.0;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getLength() {
        return length;
    }

    public double findVolume() {
        return super.findArea() * getLength();
    }

    public double findArea() {
        return 2 * super.findArea() +  2 * Math.PI * getRadius() * getLength();
    }
}
